Add a create store option to the app dev store picker - #8397
Conversation
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260826122122Caution After installing, validate the version by running |
fecda3d to
8626ddc
Compare
There was a problem hiding this comment.
Pull request overview
Adds an inline “Create a new dev store” option to the app dev store picker (for App Management orgs that already have stores), reusing the same create/poll flow introduced in the stacked base PR (#8323).
Changes:
- Introduces
StoreCreationMode = 'selection-option'and wiresapp devto opt into it. - Extends the dev store picker prompt to include a “Create a new dev store” choice (including during search) and avoids auto-selecting when that choice is available.
- Adds/updates unit tests to cover the new selection-option behavior, including cap handling and non-interactive constraints.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/app/src/cli/services/store-context.test.ts | Ensures explicit/cached store selection bypasses selection-option store listing/prompting. |
| packages/app/src/cli/services/dev/select-store.ts | Adds selection-option mode, non-interactive gating, cap-aware “create from picker” support, and shared inline creation helper. |
| packages/app/src/cli/services/dev/select-store.test.ts | Expands coverage for selection-option behavior (cap, Partners, non-interactive, create-from-non-empty). |
| packages/app/src/cli/prompts/dev.ts | Adds optional “Create a new dev store” choice to the autocomplete picker and preserves it through search/pagination. |
| packages/app/src/cli/prompts/dev.test.ts | Adds tests for pagination prompting and create-choice behavior (single store, multi store, search). |
| packages/app/src/cli/commands/app/dev.ts | Switches app dev to use storeCreationMode: 'selection-option'. |
| packages/app/src/cli/commands/app/dev.test.ts | Updates expectation to match the new storeCreationMode value. |
| .changeset/app-dev-store-picker-create-option.md | Declares a minor bump and release note for the new picker option. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
/snapit |
|
🫰✨ Thanks @nickwesselman! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260827205340Caution After installing, validate the version by running |
8626ddc to
399609b
Compare
399609b to
16f0540
Compare
Assisted-By: devx/389e4e7c-5ebc-4d59-bf3e-d0eb8c0187d3
Assisted-By: devx/4593ba0e-0e3a-4487-a065-4ae504486df8
Assisted-By: devx/4593ba0e-0e3a-4487-a065-4ae504486df8
Assisted-By: devx/4593ba0e-0e3a-4487-a065-4ae504486df8
16f0540 to
ff06e60
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Suppressed comments (3)
packages/app/src/cli/services/dev/select-store.test.ts:134
- This assertion should also verify
onCreateStoreWhenEmptyis not present. Otherwise, the test would not catch accidental introduction of the zero-store creation handler for Partners/non-interactive flows.
expect(vi.mocked(selectStorePrompt).mock.calls[0]?.[0]).not.toHaveProperty('onCreateStore')
packages/app/src/cli/services/dev/select-store.test.ts:228
- This test checks that
onCreateStoreisn't provided, but it should also assert thatonCreateStoreWhenEmptyisn't provided when the org already has stores. That keeps the test aligned with the intended behavior ofwhen-emptymode.
expect(vi.mocked(selectStorePrompt).mock.calls[0]?.[0]).not.toHaveProperty('onCreateStore')
packages/app/src/cli/services/dev/select-store.test.ts:239
- For the disabled creation mode, this test should also assert that
onCreateStoreWhenEmptyis not set, not justonCreateStore, to ensure no creation handler is accidentally exposed through the prompt options.
expect(vi.mocked(selectStorePrompt).mock.calls[0]?.[0]).not.toHaveProperty('onCreateStore')
Assisted-By: devx/4593ba0e-0e3a-4487-a065-4ae504486df8
Important
Stacked PR. Base is
dlm-app-dev-inline-store-creation(#8323), notmain. This PR only shows the store-picker option on top of the inline creation flow that #8323 adds. Do not merge before #8323.WHY are these changes introduced?
Closes shop/issues-develop#23597
#8323 lets
app devcreate a dev store inline, but only when the organization has zero stores. Developers with existing stores still have to leave the CLI to create a new one. Per the command-scope decision, the store picker inapp devshould also offer a "create store" option.WHAT is this pull request doing?
Adds a
Create a new dev storechoice to theapp devstore picker for App Management organizations that already have stores. Selecting it runs the same name/plan/create/poll flow that #8323 added for the zero-store case.StoreCreationModevalue'selection-option'; onlyapp devopts in. All other callers keep the default'disabled', and'when-empty'behavior is unchanged.shopify store create devwith the required flags, thenshopify app dev --store <store-domain>. Multiple returned stores or a partial page uses explicitshopify app dev --store <store-domain>guidance. One confirmed store still auto-selects, and explicit or cached selection still bypasses the picker.app dev. The CLI JSON outputs design defers long-lived commands such asapp devand their prompt protocol.How to test your changes?
shopify app dev --reset. The store picker lists your stores plusCreate a new dev store.shopify app dev --resetagain and pickCreate a new dev store: enter a name, pick a plan, and dev continues on the new store after the success banner.Manual tophat: this picker-entry behavior was tophatted before the stack split, on the pre-split equivalent SHA
4e85e16c(multi-store list with create choice, name/basic plan, single success banner, preview ready, explicit--storeand cached-store bypass, store list stays dev-type, standalonestore create dev --jsonunaffected, cleanup). The current child SHA has not been live-tophatted yet.Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add